/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package quanlynhatre.Model;

import quanlynhatre.Model.HocKy;
import com.db4o.Db4oEmbedded;
import com.db4o.ObjectContainer;
import com.db4o.config.Configuration;
import com.db4o.config.EmbeddedConfiguration;

/**
 *
 * @author VOTHUY
 */
public class Config {
    
    
    
    private final ObjectContainer db;
	public Config(){
                EmbeddedConfiguration config=Db4oEmbedded.newConfiguration();
                config.common().objectClass(NamHoc.class).cascadeOnUpdate(true);
                //config.common().objectClass(clsThe.class).cascadeOnDelete(true);
                //config.common().objectClass(clsTuyenduong.class).cascadeOnUpdate(true);
                //config.common().objectClass(clsTuyenduong.class).cascadeOnDelete(true);
                //config.common().updateDepth(10);
		db=Db4oEmbedded.openFile(config,"src\\DaTa\\QuanLyNhaTre.db4o");
	}
	public ObjectContainer getDb() {
		return db;
	}
    
}
